home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 691 b | 32 lines | [TEXT/ttxt] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 6, example 2
-
- --create a module to avoid naming conflicts
- module Scratch21 uses ScriptX end
- in module Scratch21
-
- -- examples for how to create objects
-
- -- using new, but with embedded objects
- global myShape := new TwoDShape \
- boundary:(object (Rect) x2:30, y2:20 end) \
- stroke:(object (Brush) color:blackColor, pattern:grayPattern \
- settings linewidth:3 end)
-
- -- using the object definition expression
- object lotsOfVars (Player)
- instance variables
- firstIV
- secondIV:@cowabunga
- thirdIV:object (PushButton) inst vars pb1 end
- end
-
- object foo (Array)
- instance vars
- a, b
- c:"purple"
- d:3, e:4
- end
- -->>>